<?php
include_once(dirname(__FILE__)."/../inc/common.php"); 

$subjectId = isset($_GET["subjectId"])?$_GET["subjectId"]+0:0;
$tallyAccountClass = new tally_account();
$account = $tallyAccountClass->findAccountByAccountId($userId, $subjectId);
?>
<!-- begin:导航条 -->
<div class="titlebar">
   <h3>记账-<?php echo $account["name"]?></h3>
</div>

<div class="tab_wrapper">

<div class="head">
	<ul class="tabs">
		<li class="active"><a href="javascript:fGoto();" onclick="Tab.activeLi(this);Credit.list('<?php echo $subjectId?>');">交易明细</a></li>
		<li><a href="javascript:fGoto();" onClick="Tab.activeLi(this);Credit.orderList('<?php echo $subjectId?>');">账单</a></li>
	</ul>
</div>

<div class="body">
	<div class="toolbar">
    	<p><a class="button" title="还信用卡"  href="javascript:fGoto();" onclick="Transfer.goAdd('34','<?php echo $subjectId?>');CM.afterSubmit=Credit.search;CM.afterSubmit0=Tally.loadBoard;"><span>还信用卡</span></a></p>
	</div>
		
		<!-- begin:搜索区 -->
		<form id="schForm" name="schForm" action="" method="post">
		<input type="hidden" name="subjectId" value="<?php echo $subjectId?>"/>
		<div class="searchbar" id ="searchbar">
			<div class="base_condition">
			<table>
			<tr>
			<td><SELECT id ="dateSpan" NAME="dateSpan" onChange="updateDate('dateSpan','dateFrom','dateTo');">
<option value="" selected>日期</option>
<option value="today">今日</option>
<option value="theWeek">本周</option>
<option value="theMonth">本月</option>
<option value="theQuarter">本季度</option>
<option value="theYear">今年</option>
<option value="lastWeek">上周</option>
<option value="lastMonth">上月</option>
<option value="lastQuarter">上季度</option>
<option value="lastYear">去年</option>
<option value="last7Day">近7天</option>
<option value="last30Day">近30天</option>
<option value="custom">自定义</option>
</SELECT>
从<INPUT class="Wdate date" TYPE="text" id="dateFrom" NAME="dateFrom" onFocus="WdatePicker();" value="" onChange="updateType('dateSpan');">
至<INPUT class="Wdate date" TYPE="text" id="dateTo" NAME="dateTo" onFocus="WdatePicker();" value="" onChange="updateType('dateSpan');">
</td>
 			<TD>
					<label for="sign">
						活动类型:
					</label>
			   
					<select name="sign" id="sign" class="m">
						<option value="">全部</option>
						<option value="1">消费</option>
						<option value="-1">还款</option>
					</select>
				</TD>
		    <td>
		    	<select name="orderField">
		    		<option value="">排序方式</option>
		    		<option value="amountDesc">金额从大到小</option>
		    		<option value="amountAsc">金额从小到大</option>
		    		<option value="tradeTimeDesc">日期由近及远</option>
		    		<option value="tradeTimeAsc">日期由远及近</option>
		    	</select>
		    </td>
			</tr>    
        	</table>
        	</div>
			<table class="complex_condition">
			<tr>
				<TD>
					<label for="categoryName">
						收支类别:
					</label>
			   </td>
			   <td>
					<input type="hidden" id="categoryId" name="categoryId" />
					<input type="text" class="text rd" id="categoryName" name="categoryName" readonly="readonly" onClick="CM.clearValue(this);">
					 <a title="收支类别" href="#"
						onclick="CategoryPicker.open(this);return false;"><img
							src="../images/icons/select.gif" align="absmiddle" />
					</a>
				</TD>	
				
			    <td><label for="tagId">标签:</label></td>
				<td>
					<input type="hidden" id="tagId" name="tagId" value=""/>
			      	<input type="text" class="text rd" id="tagName" name="tagName" readonly="readonly" onclick="CM.clearValue(this);">
			      	<a title="选择标签" href="javascript:fGoto();" onclick="TagPicker.open(this);return false;"><img src="../images/icons/select.gif" align="absmiddle"/></a>
				</td>
				<td><label for="remark">说明:</label></td>
				<td><input id="remark" name="remark" class="text" type="text" value=""></td>
				
		    	<td>
		     		<input id="searchBtn" class="button" type="button" value="查询" onclick="Credit.pg.params='';Credit.search();"/>
		    	</td>
			</tr>
		</table>
		</div>
		</form>
		<!-- end:搜索区 -->
		
		<div id="dataView" class="data">
			<div  align="center"><img align="absmiddle" src='../images/common/loading1.gif'></div>
		</div>
<!-- end:---------主数据区 -->
	</div>
</div>